package Reeks5.VanRansbeeck.Kevin.Controller;

import javax.swing.InputVerifier;
import javax.swing.JComponent;
import javax.swing.JSpinner;

public class IntegerVerifier extends InputVerifier {

    @Override
    public boolean verify(JComponent jc) {
        JSpinner js = (JSpinner)jc;
        String value = js.getValue().toString();
        
        try                                 { int i = Integer.parseInt(value); } 
        catch (NumberFormatException nfe)   { return false; }
        catch (Exception e)                 { return false; }
        
        return true;
    }
    
}
